<template>
	<view style="flex: 1;display: flex;flex-direction: column;">
		<base_navbar>
			<image src="/static/back.png" style="width: 30px;height: 30px;" mode=""></image>
		</base_navbar>
		<view style="flex:1;display: flex;flex-direction: column;
			padding-left: 12px;padding-right: 12px;">
			<!-- 标题 -->
			<view
				style="display: flex;justify-content: space-between;align-items: center;padding-top: 12px;padding-bottom: 12px;">
				<text style="font-size: 32px;">部门管理</text>
				<image @click="addHandle" src="/static/add.png" style="width: 30px;height: 30px;" mode=""></image>
			</view>
			<view style="flex: 1;background-color: #f5f5f5;overflow-y: auto;height: 0;">
				<!-- 分组列表 -->
				<view style="margin-top: 12px;" @click="groupCellClickHandle" v-for="(n,i) in 3" :key="n">
					<group_cell />
				</view>
				<!-- 用户列表 -->
				<view style="margin-top: 12px;" v-for="(n,i) in 3" :key="n">
					<member_cell />
				</view>
			</view>
			<!-- 添加 -->
			<add_pop v-if="show_add_pop" @closeHandle="show_add_pop=false;" @createHandle="createHandle"
				v-model="name" />
		</view>
	</view>
</template>

<script>
	import group_cell from "./group_cell.vue"
	import member_cell from "./member_cell.vue"
	import add_pop from "./add_pop.vue"
	import useLogin from "../../store/useLogin.js"

	export default {
		components: {
			group_cell,
			member_cell,
			add_pop
		},
		data() {
			return {
				show_add_pop:false,
				store:useLogin((state)=>state),
			}
		},
		methods: {
			addHandle() {
				this.show_add_pop = true;
			},
			createHandle() {
				this.show_add_pop = false;
				alert(this.name)
			},
			groupCellClickHandle() {
				uni.navigateTo({
					url: "./admin_group_sub",
				})
			},
		}
	}
</script>

<style>

</style>